export const getPercent = (num, fix = 1) => {
  return parseFloat((num * 100).toFixed(fix))
}

export const getLevel = flag => {
  if (flag >= 0.9) {
    return '优秀'
  } else if (flag >= 0.8) {
    return '良好'
  } else if (flag >= 0.6) {
    return '合格'
  } else {
    return '待合格'
  }
}

export const getTime = seconds => {
  const hours = Math.floor(seconds / 3600)
  const minutes = Math.ceil((seconds % 3600) / 60)
  return [hours, minutes]
}
